package serveur;

import static org.junit.Assert.*;

import java.io.PrintWriter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * Classe de test de la Classe GestionServeur
 * @author Kevin Pozderec,Faycal Abka
 *
 */
public class TestGestionServeur {
	
	GestionServeur gs ;

	@Before
	public void setUp() throws Exception {
		gs = new GestionServeur();
	}

	@After
	public void tearDown() throws Exception {
		gs = null;
	}

	@Test
	public void testAjoutClient() {
		int nb_client_avant = gs.getNombreClient();
		gs.ajouterClient(new PrintWriter(System.out));
		assertTrue(gs.getNombreClient() == (nb_client_avant+1));
	}
	
	@Test
	public void testRetirerClient() {
		int nb_client_avant = gs.getNombreClient();
		gs.retirerClient(0);
		assertTrue(gs.getNombreClient() == (nb_client_avant));
		
		gs.ajouterClient(new PrintWriter(System.out));
		gs.retirerClient(0);
		assertTrue(gs.getNombreClient() == 0);
	}

}
